package router

import (
    "github.com/gin-gonic/gin"
    jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"

    "go-admin/app/hunter/apis"
    "go-admin/common/actions"
    "go-admin/common/middleware"
)

func init() {
    routerCheckRole = append(routerCheckRole, registerHtTalentRouter)
}

// registerHtTalentRouter
func registerHtTalentRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
    api := apis.HtTalent{}
    r := v1.Group("/ht-talent").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
    {
        r.GET("", actions.PermissionAction(), api.GetPage)
        r.GET("/count/", actions.PermissionAction(), api.Count)
        r.GET("/f/", actions.PermissionAction(), api.GetPageWithoutProject)
        r.GET("/:id", actions.PermissionAction(), api.Get)
        r.POST("", api.Insert)
        r.POST("/importData", api.Import)
        r.POST("/uploadResume", api.UploadResume)
        r.PUT("/:id", actions.PermissionAction(), api.Update)
        r.DELETE("", api.Delete)
        r.DELETE("/resume", api.DeleteResume)
    }
}
